package com.yunti.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yunti.business.mapper.BaseSchoolMapper;
import com.yunti.business.domain.BaseSchool;
import com.yunti.business.service.IBaseSchoolService;

/**
 * 学校Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-22
 */
@Service
public class BaseSchoolServiceImpl implements IBaseSchoolService 
{
    @Autowired
    private BaseSchoolMapper baseSchoolMapper;

    /**
     * 查询学校
     * 
     * @param id 学校主键
     * @return 学校
     */
    @Override
    public BaseSchool selectBaseSchoolById(Long id)
    {
        return baseSchoolMapper.selectBaseSchoolById(id);
    }

    /**
     * 查询学校列表
     * 
     * @param baseSchool 学校
     * @return 学校
     */
    @Override
    public List<BaseSchool> selectBaseSchoolList(BaseSchool baseSchool)
    {
        return baseSchoolMapper.selectBaseSchoolList(baseSchool);
    }

    /**
     * 新增学校
     * 
     * @param baseSchool 学校
     * @return 结果
     */
    @Override
    public int insertBaseSchool(BaseSchool baseSchool)
    {
        baseSchool.setCreateTime(DateUtils.getNowDate());
        return baseSchoolMapper.insertBaseSchool(baseSchool);
    }

    /**
     * 修改学校
     * 
     * @param baseSchool 学校
     * @return 结果
     */
    @Override
    public int updateBaseSchool(BaseSchool baseSchool)
    {
        baseSchool.setUpdateTime(DateUtils.getNowDate());
        return baseSchoolMapper.updateBaseSchool(baseSchool);
    }

    /**
     * 批量删除学校
     * 
     * @param ids 需要删除的学校主键
     * @return 结果
     */
    @Override
    public int deleteBaseSchoolByIds(Long[] ids)
    {
        return baseSchoolMapper.deleteBaseSchoolByIds(ids);
    }

    /**
     * 删除学校信息
     * 
     * @param id 学校主键
     * @return 结果
     */
    @Override
    public int deleteBaseSchoolById(Long id)
    {
        return baseSchoolMapper.deleteBaseSchoolById(id);
    }
}
